<template>
    <template v-for="item in subMenus">
        <el-menu-item v-if="Object.keys(item).indexOf('menus') < 0" :index="item.path" :key="item.path">
            <template #title>{{item.title}}</template>
        </el-menu-item>
        <el-submenu :index="item.path" v-else :key="'key-'+item.title">
            <template #title>{{item.title}}</template>
            <menu-item :subMenus="item.menus"></menu-item>
        </el-submenu>
    </template>
</template>


<script>
export default {
    name: 'MenuItem',
    props: {
        subMenus : {
            type: Array
        }
    },

}
</script>